import java.util.Scanner;

public class addrCollection
{
	Scanner scan = new Scanner (System.in);
	public Addr[] collection;
	public int count;
	
	//String[] lastName = new String[100];
	//String[] firstName = new String[100];

	public addrCollection () 
	{ 
		collection = new Addr[100];
		count = 0;
	}

	public void addAddr (String lastName, String firstName, String position, String department, String companyName, String addr, int telephoneNum, int faxNum, int mobileNum, String email, String homepage) 
	{
		if (count == collection.length)
			increaseSize();
		
		collection[count] = new Addr (lastName, firstName, position, department, companyName, addr, telephoneNum, faxNum, mobileNum, email, homepage); 
		count++;
	}

	/*public void nameAdd(String lastName, String firstName)
	{
		lastName[count] = lastName;
		firstName[count] = firstName;
	}

	public String getlastName()
	{
		return lastName[count];
	}
	
	public String getfirstName()
	{
		return firstName[count];
	}*/

	public void increaseSize ()
	{
		Addr[] temp = new Addr[collection.length * 2];

		for (int addr = 0; addr < collection.length; addr++) 
			temp[addr] = collection[addr];
		collection = temp;
	}

	public String numtoString()
        {
                String numreport = "";
                
                for(int n=0; n<count; n++)
				{
					if(collection[n] != null)
                        numreport += (n+1)+ "/t" + collection[n].toString() + "\n";
					else
						n--;
				}
                
                return numreport;
        }
        
	public void delete(int deletenum)
	{
			if(deletenum==0)
			{
					for(int q=0; q<count; q++)
							collection[q] = null;
			}
			else
			{
					collection[deletenum-1] = null;
			}

			
	}
        
	public String toString ()
	{
			String report = "";
			
				for(int num=0; num<count; num++)
				{
					if(collection[num] != null)
						report += collection[num].toString() + "\n";
					
				}
			

			return report;
	}
}